home *** CD-ROM | disk | FTP | other *** search
- TMyBars = class
- private
- FooBars: TList;
- CandyBars: TList;
- SandBars: TList;
- WineBars: TList;
- function GetBarCount(Index: Integer): Integer;
- function GetBar(Item: Integer; Index: Integer): Pointer;
- procedure SetBarCount(Index: Integer; Value: Integer);
- procedure SetBar(Item: Integer; Index: Integer; Value: Pointer);
- public
- property FooBarCount: Integer index 0
- read GetBarCount write SetBarCount;
- property CandyBarCount: Integer index 1
- read GetBarCount write SetBarCount;
- property SandBarCount: Integer index 2
- read GetBarCount write SetBarCount;
- property WineBarCount: Integer index 3
- read GetBarCount write SetBarCount;
- property FooBar[Item: Integer]: Pointer index 0
- read GetBar write SetBar;
- property CandyBar[Item: Integer]: Pointer index 1
- read GetBar write SetBar;
- property SandBar[Item: Integer]: Pointer index 2
- read GetBar write SetBar;
- property WineBar[Item: Integer]: Pointer index 3
- read GetBar write SetBar;
- end;
- . . .
- function TMyBars.GetBar(Item, Index: Integer): Pointer;
- begin
- case Index of
- 0: Result := FooBars[Item];
- 1: Result := CandyBars[Item];
- 2: Result := SandBars[Item];
- else
- Result := WineBars[Item];
- end;
- end;
- function TMyBars.GetBarCount(Index: Integer): Integer;
- begin
- case Index of
- 0: Result := FooBars.Count;
- 1: Result := CandyBars.Count;
- 2: Result := SandBars.Count;
- else
- Result := WineBars.Count;
- end;
- end;
- procedure TMyBars.SetBar(Item, Index: Integer; Value: Pointer);
- begin
- case Index of
- 0: FooBars[Item] := Value;
- 1: CandyBars[Item] := Value;
- 2: SandBars[Item] := Value;
- else
- WineBars[Item] := Value;
- end;
- end;
- procedure TMyBars.SetBarCount(Index, Value: Integer);
- begin
- case Index of
- 0: FooBars.Count := Value;
- 1: CandyBars.Count := Value;
- 2: SandBars.Count := Value;
- else
- WineBars.Count := Value;
- end;
- end;